package com.example.dingtalklogin.manager.dingtalk;

import com.example.dingtalklogin.common.util.SpringUtil;
import feign.RequestInterceptor;
import feign.RequestTemplate;

public class OApiTokenInterceptor implements RequestInterceptor {
    @Override
    public void apply(RequestTemplate requestTemplate) {
        AccessTokenManager accessTokenManager = SpringUtil.getBean(AccessTokenManager.class);
        // oapi的token在url ?里面不在header里面
        requestTemplate.query("access_token", accessTokenManager.getToken());
    }
}
